package crmdna.mail;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.googlecode.objectify.annotation.Cache;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;
import com.googlecode.objectify.condition.IfNotNull;
import com.googlecode.objectify.condition.IfTrue;

import crmdna.mail.Mail.MailStatus;

@Entity
@Cache
public class SentMailEntity {
  @Id
  String sentMailId;

  @Index(IfNotNull.class)
  Long memberId;

  @Index
  String email;

  String from;

  long queuedTS;
  long sendTS;

  @Index(IfTrue.class)
  boolean opened;

  String openTS;
  String country;
  String region;
  String city;
  boolean mobile;

  @Index(IfTrue.class)
  boolean spam;

  public MailStatus status;
  public long statusTS;

  public String rejectReason;

  public boolean clicked;

  // store details for every click
  public List<Long> clickTS;
  public List<String> clickUrls;

  public Set<String> tags = new HashSet<>();
  @Index
  public Long bulkEmailId;
}
